#!/bin/bash -e

rm -rf ./dl-assets/
mkdir -p ./dl-assets/
pushd dl-assets/
wget https://github.com/89luca89/distrobox/archive/refs/tags/1.4.2.1.tar.gz
tar xvf 1.4.2.1.tar.gz
pushd distrobox-1.4.2.1/
./install --prefix "$PWD/.."
popd
for manpage in $(ls ./share/man/man1/); do
  gzip "./share/man/man1/$manpage"
done
popd
dpkg-buildpackage -us -uc
lintian ../distrobox_1.4.2.1~spark2_all.deb
